class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        index = 0
        length = len(nums)
        item = nums[0]
        for i in range(1, length):
            if nums[i] != item:
                index += 1
                nums[index] = nums[i]
                item = nums[i]
            else:
                continue
        return index + 1
